package com.zryc.shop.base;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {

    private Integer code;
    private Object data;
    private String message;


    public static Result ok(Object data) {
        return new Result(200, data, "success");
    }

    public static Result ok() {
        return new Result(200, "", "success");
    }

    public static Result error(Integer code, String message) {
        return new Result(code, null, message);
    }



}
